package com.jzr.medical.db1.dto;

import com.jzr.common.util.Convert;
import com.jzr.common.util.U;
import com.jzr.medical.db1.model.TWorkPlan;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.time.LocalDate;

@Getter
@Setter
@NoArgsConstructor
public class WorkPlanDto extends TWorkPlan {
    private Integer pageNum;
    private Integer pageSize;
    private LocalDate planDateFrom;
    private LocalDate planDateTo;
    private String orderByClause;
    public String getOrderByClause(){
        if(U.isBlank(orderByClause)){
            return "plan_date,work_type";
        }else {
            return Convert.camelToUnderline(orderByClause);
        }
    }
    public Integer getPageNum(){
        return pageNum ==null ? 1 : pageNum;
    }
    public Integer getPageSize(){
        return pageSize==null ? 20:pageSize;
    }
}
